<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   谢益辉: 用局部加权回归散点平滑法观察二维变量之间的关系  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({
          tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
          TeX: {equationNumbers: {autoNumber: "AMS"}}
        });
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466459942: Accept with keywords: (title(0.545454545455):关系,加权,变量,门户网站,局部,统计学,散点,回归,服务平台,中国,平滑, topn(0.6):统计图,散点图,统计学,R语言,图形,加权,因变量,模型,物种,文章,可视化,数目,平滑,抽样,变量,数据,老师,回归,样本,散点,拟合,趋势,关系,直线,方法,代码,曲线,海拔,连续变量,局部).-->
 </head>
 <body class="single single-post postid-57 single-format-standard sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    谢益辉: 用局部加权回归散点平滑法观察二维变量之间的关系
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/">
       <img src="http://cos.name/wp-content/themes/COS-kermesinus/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <a class="screen-reader-text skip-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#content" title="跳至内容">
        跳至内容
       </a>
       <div class="menu-%e6%88%91%e7%9a%84%e8%8f%9c%e5%8d%95-container">
        <ul class="nav-menu" id="menu-%e6%88%91%e7%9a%84%e8%8f%9c%e5%8d%95">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-4746" id="menu-item-4746">
          <a href="http://cos.name">
           主页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-8120" id="menu-item-8120">
          <a href="http://cos.name/cn">
           论坛
          </a>
          <ul class="sub-menu">
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8124" id="menu-item-8124">
            <a href="http://cos.name/cn/wp-login.php?action=register">
             论坛注册
            </a>
           </li>
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8125" id="menu-item-8125">
            <a href="http://cos.name/cn/wp-login.php">
             论坛登录
            </a>
           </li>
          </ul>
         </li>
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8110" id="menu-item-8110">
          <a href="http://cos.name/books/">
           图书资料
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8112" id="menu-item-8112">
          <a href="http://cos.name/videos">
           视频教程
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8333" id="menu-item-8333">
          <a href="http://cos.name/salon/">
           统计沙龙
          </a>
         </li>
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8111" id="menu-item-8111">
          <a href="http://cos.name/chinar/">
           R语言会议
          </a>
         </li>
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8109" id="menu-item-8109">
          <a href="http://cos.name/training/">
           讲座与培训
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8115" id="menu-item-8115">
          <a href="http://cos.name/cn/forum/comprehensive/job/">
           招聘信息
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-4780" id="menu-item-4780">
          <a href="http://cos.name/about">
           关于我们
          </a>
          <ul class="sub-menu">
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8113" id="menu-item-8113">
            <a href="http://cos.name/2008/11/how-to-work-with-cos/">
             加入我们
            </a>
           </li>
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8119" id="menu-item-8119">
            <a href="http://cos.name/donate/">
             赞助我们
            </a>
           </li>
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8114" id="menu-item-8114">
            <a href="http://cos.name/cn/forum/26">
             项目合作
            </a>
           </li>
          </ul>
         </li>
        </ul>
       </div>
       <form action="http://cos.name/" class="search-form" method="get" role="search">
        <label>
         <span class="screen-reader-text">
          搜索：
         </span>
        </label>
       </form>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-57 post type-post status-publish format-standard hentry category-linearmodel category-featured category-graphics tag-bootstrap tag-loess tag-lowess tag-r-language tag-54 tag-50 tag-52 tag-57 tag-56" id="post-57">
        <header class="entry-header">
         <h1 class="entry-title">
          用局部加权回归散点平滑法观察二维变量之间的关系
         </h1>
         <div class="entry-meta">
          <span class="date">
           <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/" rel="bookmark" title="链向用局部加权回归散点平滑法观察二维变量之间的关系的固定链接">
            <time class="entry-date" datetime="2008-11-26T13:57:27+00:00">
             2008/11/26
            </time>
           </a>
          </span>
          <span class="categories-links">
           <a href="http://cos.name/category/models/linearmodel/" rel="category tag">
            回归分析
           </a>
           、
           <a href="http://cos.name/category/website/featured/" rel="category tag">
            推荐文章
           </a>
           、
           <a href="http://cos.name/category/software/graphics/" rel="category tag">
            统计图形
           </a>
          </span>
          <span class="tags-links">
           <a href="http://cos.name/tag/bootstrap/" rel="tag">
            Bootstrap
           </a>
           、
           <a href="http://cos.name/tag/loess/" rel="tag">
            LOESS
           </a>
           、
           <a href="http://cos.name/tag/lowess/" rel="tag">
            LOWESS
           </a>
           、
           <a href="http://cos.name/tag/r-language/" rel="tag">
            R语言
           </a>
           、
           <a href="http://cos.name/tag/%e5%9b%9e%e5%bd%92/" rel="tag">
            回归
           </a>
           、
           <a href="http://cos.name/tag/%e5%b1%80%e9%83%a8%e5%8a%a0%e6%9d%83%e5%9b%9e%e5%bd%92%e6%95%a3%e7%82%b9%e5%b9%b3%e6%bb%91%e6%b3%95/" rel="tag">
            局部加权回归散点平滑法
           </a>
           、
           <a href="http://cos.name/tag/%e7%9b%b8%e5%85%b3/" rel="tag">
            相关
           </a>
           、
           <a href="http://cos.name/tag/%e7%bb%9f%e8%ae%a1%e5%9b%be%e5%bd%a2/" rel="tag">
            统计图形
           </a>
           、
           <a href="http://cos.name/tag/%e9%87%8d%e6%8a%bd%e6%a0%b7/" rel="tag">
            重抽样
           </a>
          </span>
          <span class="author vcard">
           <a class="url fn n" href="http://cos.name/author/yihui/" rel="author" title="查看所有由谢益辉发布的文章">
            谢益辉
           </a>
          </span>
         </div>
         <!-- .entry-meta -->
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <figure class="wp-caption alignleft" id="attachment_71" style="width: 150px">
          <a href="http://cos.name/wp-content/uploads/2008/11/counts.png">
           <img src="http://cos.name/wp-content/uploads/2008/11/counts-150x150.png"/>
          </a>
          <figcaption class="wp-caption-text">
           局部加权回归散点平滑法
          </figcaption>
         </figure>
         <p>
          二维变量之间的关系研究是很多统计方法的基础，例如回归分析通常会从一元回归讲起，然后再扩展到多元情况。局部加权回归散点平滑法（locally weighted scatterplot smoothing，LOWESS或LOESS）是查看二维变量之间关系的一种有力工具。
         </p>
         <p>
          LOWESS主要思想是取一定比例的局部数据，在这部分子集中拟合多项式回归曲线，这样我们便可以观察到数据在局部展现出来的规律和趋势；而通常的回归分析往往是根据全体数据建模，这样可以描述整体趋势，但现实生活中规律不总是（或者很少是）教科书上告诉我们的一条直线。我们将局部范围从左往右依次推进，最终一条连续的曲线就被计算出来了。显然，曲线的光滑程度与我们选取数据比例有关：比例越少，拟合越不光滑（因为过于看重局部性质），反之越光滑。
          <span id="more-57">
          </span>
         </p>
         <p>
          本文的数据文件：
          <a href="http://cos.name/wp-content/uploads/2008/11/counts.txt" title="物种数目与海拔高度数据">
           物种数目与海拔高度
          </a>
          （感谢中科院植物所赖江山博士提供数据并授权使用）
         </p>
         <p>
          R程序代码：
         </p>
         <pre class="brush: r"># 从本站counts.txt文件直接将数据读入R
x = read.csv("http://cos.name/wp-content/uploads/2008/11/counts.txt")
par(las = 1, mar = c(4, 4, 0.1, 0.1))
plot(x, pch = 20, col = rgb(0, 0, 0, 0.5))
# 取不同的f参数值
for (i in seq(0.01, 1, length = 100)) {
    lines(lowess(x$altitude, x$counts, f = i), col = gray(i),
        lwd = 1.5)
    Sys.sleep(0.15)
}</pre>
         <p>
          以上
          <em>
           Sys.sleep()
          </em>
          语句只是为了让读者看清楚添加LOWESS曲线的过程，实际画图过程中可以去掉。以上代码生成的图形如下：
         </p>
         <figure class="wp-caption aligncenter" id="attachment_71" style="width: 480px">
          <a href="http://cos.name/wp-content/uploads/2008/11/counts.png">
           <img src="http://cos.name/wp-content/uploads/2008/11/counts.png"/>
          </a>
          <figcaption class="wp-caption-text">
           局部加权回归散点平滑法
          </figcaption>
         </figure>
         <p>
          上图中，曲线颜色越浅表示所取数据比例越大。不难看出白色的曲线几乎已呈直线状，而黑色的线则波动较大。总体看来，图中大致有四处海拔上的物种数目偏离回归直线较严重：450米、550米、650米和700米附近。若研究者的问题是，多高海拔处的物种数最多？那么答案应该是在650米附近。如果仅仅从回归直线来看，似乎是海拔越高，则物种数目越多。如此推断下去，恐怕月球或火星上该物种最多。以下是回归直线的图示：
         </p>
         <pre class="brush: r">par(las = 1, mar = c(4, 4, 0.1, 0.1), mgp = c(2.5,
    1, 0))
plot(x, pch = 20, col = rgb(0, 0, 0, 0.5))
abline(lm(counts ~ altitude, x), lwd = 2, col = "red")</pre>
         <figure class="wp-caption aligncenter" id="attachment_74" style="width: 480px">
          <a href="http://cos.name/wp-content/uploads/2008/11/counts-regression.png">
           <img src="http://cos.name/wp-content/uploads/2008/11/counts-regression.png"/>
          </a>
          <figcaption class="wp-caption-text">
           物种数目与海拔高度的关系：回归直线
          </figcaption>
         </figure>
         <p>
          为了确保我们用LOWESS方法得到的趋势是稳定的，我们可以进一步用Bootstrap的方法验证。因为Bootstrap方法是对原样本进行重抽样，根据抽得的不同样本可以得到不同的LOWESS曲线，最后我们把所有的曲线添加到图中，看所取样本不同是否会使得LOWESS有显著变化；以下是R代码：
         </p>
         <pre class="brush: r">set.seed(711) # 设定随机数种子，保证本图形可以重制
par(las = 1, mar = c(4, 4, 0.1, 0.1), mgp = c(2.5,
    1, 0))
plot(x, pch = 20, col = rgb(0, 0, 0, 0.5))
for (i in 1:400) {
    idx = sample(nrow(x), 300, TRUE) # 有放回抽取300个样本序号
    lines(lowess(x$altitude[idx], x$counts[idx]), col = rgb(0,
        0, 0, 0.05), lwd = 1.5) # 用半透明颜色，避免线条重叠使得图形看不清
    Sys.sleep(0.05)
}
dev.off()</pre>
         <p>
          生成图形如下：
         </p>
         <figure class="wp-caption aligncenter" id="attachment_75" style="width: 480px">
          <a href="http://cos.name/wp-content/uploads/2008/11/counts-bootstrap.png">
           <img src="http://cos.name/wp-content/uploads/2008/11/counts-bootstrap.png"/>
          </a>
          <figcaption class="wp-caption-text">
           物种数目与海拔高度的关系：Bootstrap结合LOWESS查看
          </figcaption>
         </figure>
         <p>
          可以看出，经过400次重抽样并计算LOWESS曲线，刚才在第一幅图中观察到的趋势大致都还存在（因为默认取数据比例为2/3，因此拟合曲线都比较光滑），只是700米海拔附近物种数目减小的趋势并不明显了，这是因为这个海拔附近的观测样本量较少，在重抽样的时候不容易被抽到，因此在图中代表性不足，最后得到的拟合曲线分布稀疏。
         </p>
         <p>
          <span style="color: #808080;">
           <strong>
            作者注
           </strong>
           ：只是一副散点图而已，能做的文章并不少。本文是基于赖博士的另外一个问题而引发出来的思考，供生物与生态专业的同仁参考。值此新建站点之际，谨以此文抛砖，望能引来更多高人对COS网站贡献的“美玉”。作者联系方式：xie[at]yihui.name
          </span>
         </p>
         <div class="wumii-hook">
          <br/>
          <br/>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
         <div class="author-info">
          <div class="author-avatar">
           <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
          </div>
          <!-- .author-avatar -->
          <div class="author-description">
           <h2 class="author-title">
            关于谢益辉
           </h2>
           <p class="author-bio">
            RStudio码了个工，Iowa State University统计系博了个士。统计之都网站创办者；研究兴趣为统计图形及数据可视化，对统计模型方法的发展感兴趣但不喜欢纯粹抽象的数学理论，以直观、实用为学习标准；偏好以R语言为工具；Email：xie@yihui.name；个人主页：
            <a href="http://yihui.name">
             http://yihui.name
            </a>
            <a class="author-link" href="http://cos.name/author/yihui/" rel="author">
             查看所有由谢益辉发表的文章
             <span class="meta-nav">
              →
             </span>
            </a>
           </p>
          </div>
          <!-- .author-description -->
         </div>
         <!-- .author-info -->
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
       <nav class="navigation post-navigation" role="navigation">
        <h1 class="screen-reader-text">
         文章导航
        </h1>
        <div class="nav-links">
         <a href="http://cos.name/2008/11/domain-of-statistics-by-yihui/" rel="prev">
          <span class="meta-nav">
           ←
          </span>
          统计学的领域（写给在统计学院学习的学弟学妹之一）
         </a>
         <a href="http://cos.name/2008/11/statistics-history-and-today/" rel="next">
          统计学的历史与今天
          <span class="meta-nav">
           →
          </span>
         </a>
        </div>
        <!-- .nav-links -->
       </nav>
       <!-- .navigation -->
       <div class="comments-area" id="comments">
        <h2 class="comments-title">
         《
         <span>
          用局部加权回归散点平滑法观察二维变量之间的关系
         </span>
         》有27个想法
        </h2>
        <ol class="comment-list">
         <li class="pingback even thread-even depth-1" id="comment-39">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://cos.name/2008/11/cos-navigation-1/" rel="external nofollow">
            郑冰: 统计之都《本周导读》第一辑 | 统计之都
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="trackback odd alt thread-odd thread-alt depth-1" id="comment-47">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://www.yihui.name/cn/post/225.htm" rel="external nofollow">
            Keep on Fighting!
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-80">
          <article class="comment-body" id="div-comment-80">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/34e0143fb09d6f1a82876586307be50c?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              lovelyday
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-80">
              <time datetime="2008-12-04T08:49:15+00:00">
               2008/12/04 08:49
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             就technique background 和 application来说讲得基本到位哈。但是我觉得对于统计方法的描述上，如果能结合背景知识来讲的话效果会更好。因为数据只是数据，而统计模型就是因数据而生，看上去任何一种方法都很好。但是实际上，统计模型具有很浓厚的背景性。比如lowess方法，它有一个hidden assumption就是，你必须知道你的这个smooth regression model是实际而且可以intepret的。（这个东西本身就是从生物，医学或者社会学领域发展来的，人家已经知道两个变量之间是有关系的，所以才发展了这些非线性方法去建模）。可想而知，这样的模型应该是比简单的线性要好。但是，如果在实际应用当中这个前提不能满足的话，这个模型的uncertainty就大大增加了。很显然，参数越多，模型看上去对数据的拟合越好，那么你怎么去计算你得到的这个relationship的可靠度呢？（type-i and type-ii errors）？ 这一直是统计学界最担心的问题，统计模型的解释和应用。比如，chaos理论里有大量的简单的dynamic system可以模拟出非常随机的数据，而很多统计模型可以把这些数据拟合得非常好，但是事实上这些模型都是错的。：（
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给lovelyday" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=80#respond" onclick='return addComment.moveForm( "div-comment-80", "80", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment byuser comment-author-admin odd alt thread-odd thread-alt depth-1 parent" id="comment-86">
          <article class="comment-body" id="div-comment-86">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/9cc19eb474404f7513e86e2208ddd4ff?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://www.yihui.name" rel="external nofollow">
               谢益辉
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-86">
              <time datetime="2008-12-04T15:38:23+00:00">
               2008/12/04 15:38
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             嗯，确实应该请给我数据的人来评价一下，统计学方法只有和相关专业知识结合起来才有用，而不能闭门造车还觉得自己造的挺好看 😛
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=86#respond" onclick='return addComment.moveForm( "div-comment-86", "86", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2 parent" id="comment-648">
            <article class="comment-body" id="div-comment-648">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/2848671282276450a152bb08d3f99996?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                wudonghao
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-648">
                <time datetime="2009-06-03T09:38:21+00:00">
                 2009/06/03 09:38
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               谢老师，能否将LOESS拟合的脚本发一份给我？谢谢！
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给wudonghao" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=648#respond" onclick='return addComment.moveForm( "div-comment-648", "648", "respond", "57" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment byuser comment-author-yihui bypostauthor odd alt depth-3" id="comment-649">
              <article class="comment-body" id="div-comment-649">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  <a class="url" href="http://www.yihui.name" rel="external nofollow">
                   谢益辉
                  </a>
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-649">
                  <time datetime="2009-06-03T14:32:49+00:00">
                   2009/06/03 14:32
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 见正文R代码。数据、程序都有。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1 parent" id="comment-265">
          <article class="comment-body" id="div-comment-265">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/dc5341de570bfd02f229eea5a4781d85?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              fisheat
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-265">
              <time datetime="2009-01-28T20:14:00+00:00">
               2009/01/28 20:14
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             yihui，你好。
             <br/>
             我看到有些文献中通过cox regression计算martingale residuals，随后通过绘制mr的scatter plot，计算和0交界的值来确定cut off。
             <br/>
             能介绍一下原理吗？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给fisheat" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=265#respond" onclick='return addComment.moveForm( "div-comment-265", "265", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yihui bypostauthor odd alt depth-2 parent" id="comment-622">
            <article class="comment-body" id="div-comment-622">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://www.yihui.name" rel="external nofollow">
                 谢益辉
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-622">
                <time datetime="2009-05-22T23:45:40+00:00">
                 2009/05/22 23:45
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               抱歉我已经忘了martingale residuals的意思，但我感觉应该是观察残差的趋势（普通的散点图可能不容易观察）
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=622#respond" onclick='return addComment.moveForm( "div-comment-622", "622", "respond", "57" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
            <ol class="children">
             <li class="comment even depth-3" id="comment-651">
              <article class="comment-body" id="div-comment-651">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/2848671282276450a152bb08d3f99996?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  wudonghao
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-651">
                  <time datetime="2009-06-03T22:28:58+00:00">
                   2009/06/03 22:28
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 谢老师，谢谢你的指点，还有一个问题想请教下，如果loess拟合只要得到第二个图那样的只有点位和曲线的图，该怎样写代码？请原谅我的无知。多谢……
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment byuser comment-author-yihui bypostauthor odd alt depth-3" id="comment-652">
              <article class="comment-body" id="div-comment-652">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  <a class="url" href="http://www.yihui.name" rel="external nofollow">
                   谢益辉
                  </a>
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-652">
                  <time datetime="2009-06-03T23:27:19+00:00">
                   2009/06/03 23:27
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 看正文R代码，依葫芦画瓢吧。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment even depth-3" id="comment-673">
              <article class="comment-body" id="div-comment-673">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/2848671282276450a152bb08d3f99996?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  wudonghao
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-673">
                  <time datetime="2009-06-09T09:27:24+00:00">
                   2009/06/09 09:27
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 谢老师，你好：
                 <br/>
                 又来打搅你了，拟合曲线我画出来了，现在我需要在曲线上找到breakpoint，但不知道怎么用rpart函数，能不能就本例指点下？谢谢.
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
             <li class="comment byuser comment-author-yihui bypostauthor odd alt depth-3" id="comment-674">
              <article class="comment-body" id="div-comment-674">
               <footer class="comment-meta">
                <div class="comment-author vcard">
                 <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
                 <b class="fn">
                  <a class="url" href="http://www.yihui.name" rel="external nofollow">
                   谢益辉
                  </a>
                 </b>
                 <span class="says">
                  说道：
                 </span>
                </div>
                <!-- .comment-author -->
                <div class="comment-metadata">
                 <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-674">
                  <time datetime="2009-06-09T12:31:52+00:00">
                   2009/06/09 12:31
                  </time>
                 </a>
                </div>
                <!-- .comment-metadata -->
               </footer>
               <!-- .comment-meta -->
               <div class="comment-content">
                <p>
                 什么叫breakpoint？如何定义？回归树中自变量的拆分点？看
                 <code>
                  ?rpart
                 </code>
                 及其返回值及其相应的帮助文档吧，关键是了解返回结果的数据对象类型以及怎么从中取值出来。
                </p>
               </div>
               <!-- .comment-content -->
              </article>
              <!-- .comment-body -->
             </li>
             <!-- #comment-## -->
            </ol>
            <!-- .children -->
           </li>
           <!-- #comment-## -->
           <li class="comment even depth-2" id="comment-6973">
            <article class="comment-body" id="div-comment-6973">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/97f200fc838f63adcaaa4bed490880d7?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                姬玲粉
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-6973">
                <time datetime="2015-12-01T17:46:22+00:00">
                 2015/12/01 17:46
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               你好，我遇到了同样的问题，您是否已经搞清楚了，能否给予帮助？感谢！
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给姬玲粉" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=6973#respond" onclick='return addComment.moveForm( "div-comment-6973", "6973", "respond", "57" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-621">
          <article class="comment-body" id="div-comment-621">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/b4c8dc5e327f127f346ffa11b79bb944?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              peggy
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-621">
              <time datetime="2009-05-22T23:38:35+00:00">
               2009/05/22 23:38
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             益辉，呵呵，我来转转，这些东西我都不懂，不过能看出来这个网站真的很棒，你很用心，辛苦了！yujie
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给peggy" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=621#respond" onclick='return addComment.moveForm( "div-comment-621", "621", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yihui bypostauthor even depth-2" id="comment-623">
            <article class="comment-body" id="div-comment-623">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://www.yihui.name" rel="external nofollow">
                 谢益辉
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-623">
                <time datetime="2009-05-22T23:46:19+00:00">
                 2009/05/22 23:46
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               哈哈，你是咱班第一个来这里吼一嗓子的，谢谢支持！
               <img src="http://cos.name/wp-includes/images/smilies/mrgreen.png"/>
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=623#respond" onclick='return addComment.moveForm( "div-comment-623", "623", "respond", "57" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-1695">
          <article class="comment-body" id="div-comment-1695">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/0cc73b0ff339b002fd626a989e261ea2?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Zhangtao
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-1695">
              <time datetime="2010-10-27T09:48:02+00:00">
               2010/10/27 09:48
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             非常佩服谢老师！
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Zhangtao" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=1695#respond" onclick='return addComment.moveForm( "div-comment-1695", "1695", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-1786">
          <article class="comment-body" id="div-comment-1786">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/d7cab676a126b659d8eeb1c8b8f5b9bf?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              gamou
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-1786">
              <time datetime="2010-12-23T10:18:24+00:00">
               2010/12/23 10:18
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             若因变量变成名义变量，自变量是连续变量，loess还可以做吗？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给gamou" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=1786#respond" onclick='return addComment.moveForm( "div-comment-1786", "1786", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yihui bypostauthor odd alt depth-2" id="comment-1787">
            <article class="comment-body" id="div-comment-1787">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yihui.name" rel="external nofollow">
                 谢益辉
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-1787">
                <time datetime="2010-12-23T10:28:54+00:00">
                 2010/12/23 10:28
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               LOWESS本质上就是（加权）局部回归，所以理论上只要回归能做，LOWESS就能做，但我没见过你说的这种情况。LOWESS的初衷是为了检查散点图中的趋势（它具有较好的耐抗性，离群点的影响不大），而散点图通常是连续变量对连续变量的图。若因变量是离散变量，那么散点图本身的意义就不大了，仅仅在一些非常特殊的情况下可能有用，例如因变量为二分类。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=1787#respond" onclick='return addComment.moveForm( "div-comment-1787", "1787", "respond", "57" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1 parent" id="comment-2654">
          <article class="comment-body" id="div-comment-2654">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/8bce8a6da031c2577ea480057979cb05?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              ruikoeln
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-2654">
              <time datetime="2011-12-20T13:19:43+00:00">
               2011/12/20 13:19
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             时隔3年来读这个文章，感觉很有收益。统计的东西，如果和直观都相左，就没有太多大意思。从这个意义上讲，LOWESS还是非常有用的。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给ruikoeln" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=2654#respond" onclick='return addComment.moveForm( "div-comment-2654", "2654", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yihui bypostauthor odd alt depth-2" id="comment-2655">
            <article class="comment-body" id="div-comment-2655">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yihui.name" rel="external nofollow">
                 谢益辉
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-2655">
                <time datetime="2011-12-20T13:25:54+00:00">
                 2011/12/20 13:25
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               我最喜欢回来看老文章的读者了，这对作者是很大的鼓励。我们不求更新最快，但求老文章一直有人看。
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=2655#respond" onclick='return addComment.moveForm( "div-comment-2655", "2655", "respond", "57" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1 parent" id="comment-3993">
          <article class="comment-body" id="div-comment-3993">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/eeb956028abeccd718ad47522ecb6291?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              celery
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-3993">
              <time datetime="2013-04-13T21:31:42+00:00">
               2013/04/13 21:31
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             谢老师，您好！您这篇文章对我帮助很大，但我还想问一下LOWESS拟合出来的曲线，可以用方程具体表达么？应该怎样操作呢？谢谢(*^__^*)
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给celery" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=3993#respond" onclick='return addComment.moveForm( "div-comment-3993", "3993", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment byuser comment-author-yihui bypostauthor odd alt depth-2" id="comment-4021">
            <article class="comment-body" id="div-comment-4021">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                <a class="url" href="http://yihui.name" rel="external nofollow">
                 谢益辉
                </a>
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-4021">
                <time datetime="2013-04-16T12:48:30+00:00">
                 2013/04/16 12:48
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               LOWESS拟合的曲线很难也没有必要用方程表达，它是一种平滑方法，而且主要用在散点图中，看图即可。没有人说科学一定要通过方程表达吧：）
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给谢益辉" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=4021#respond" onclick='return addComment.moveForm( "div-comment-4021", "4021", "respond", "57" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-4186">
          <article class="comment-body" id="div-comment-4186">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/473ec3c02598b3dbf2ee371a682037d8?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              olivia
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-4186">
              <time datetime="2013-05-11T19:09:50+00:00">
               2013/05/11 19:09
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             谢老师您好，我想请教一下，画lowess图的时候可以同时控制sampling weight吗？我使用的是survey数据，通过PPS进行取样，为了让sample更有代表性，我想使用sampling weight进行加权。（这个逻辑对吗？） 同时这个数据还提供weight with non-response adjustment,这个会对结果有什么影响吗？
             <br/>
             谢谢！
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给olivia" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=4186#respond" onclick='return addComment.moveForm( "div-comment-4186", "4186", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-4721">
          <article class="comment-body" id="div-comment-4721">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://weibo.com/sisyfus" rel="external nofollow">
               Sisyfus
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-4721">
              <time datetime="2013-08-26T23:08:59+00:00">
               2013/08/26 23:08
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             R的作图功能还是很强大的。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Sisyfus" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=4721#respond" onclick='return addComment.moveForm( "div-comment-4721", "4721", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-4887">
          <article class="comment-body" id="div-comment-4887">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://t.qq.com/ling21" rel="external nofollow">
               雲
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-4887">
              <time datetime="2013-09-23T02:51:50+00:00">
               2013/09/23 02:51
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             好文！
             <br/>
             如果把distance weight比作edge, point比作vertex， 那要是不单单edge有权重，vertex也有权重的话， 请教有没有此类的 weight function?
             <br/>
             多谢师兄！
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给雲" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=4887#respond" onclick='return addComment.moveForm( "div-comment-4887", "4887", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1" id="comment-5503">
          <article class="comment-body" id="div-comment-5503">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://weibo.com/1949121220" rel="external nofollow">
               向日树li
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-5503">
              <time datetime="2014-04-07T23:19:13+00:00">
               2014/04/07 23:19
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             不错！
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给向日树li" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=5503#respond" onclick='return addComment.moveForm( "div-comment-5503", "5503", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-even depth-1" id="comment-6642">
          <article class="comment-body" id="div-comment-6642">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/cd14d34da79ac3b4c8d1f41af9defc88?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              颜羽瑶
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#comment-6642">
              <time datetime="2015-03-22T21:58:49+00:00">
               2015/03/22 21:58
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             请问三维的数据 lowess可以做非参数回归吗？？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给颜羽瑶" class="comment-reply-link" href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/?replytocom=6642#respond" onclick='return addComment.moveForm( "div-comment-6642", "6642", "respond", "57" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
        </ol>
        <!-- .comment-list -->
        <div class="comment-respond" id="respond">
         <h3 class="comment-reply-title" id="reply-title">
          发表评论
          <small>
           <a href="http://cos.name/2008/11/lowess-to-explore-bivariate-correlation-by-yihui/#respond" id="cancel-comment-reply-link" rel="nofollow" style="display:none;">
            取消回复
           </a>
          </small>
         </h3>
         <form action="http://cos.name/wp-comments-post.php" class="comment-form" id="commentform" method="post" novalidate="">
          <p class="comment-notes">
           <span id="email-notes">
            电子邮件地址不会被公开。
           </span>
           必填项已用
           <span class="required">
            *
           </span>
           标注
          </p>
          <p class="comment-form-comment">
           <label for="comment">
            评论
           </label>
           <textarea aria-required="true" cols="45" id="comment" maxlength="65525" name="comment" required="required" rows="8">
           </textarea>
          </p>
          <p class="comment-form-author">
           <label for="author">
            姓名
            <span class="required">
             *
            </span>
           </label>
          </p>
          <p class="comment-form-email">
           <label for="email">
            电子邮件
            <span class="required">
             *
            </span>
           </label>
          </p>
          <p class="comment-form-url">
           <label for="url">
            站点
           </label>
          </p>
          <p class="form-submit">
          </p>
          <p style="display: none;">
          </p>
          <p style="display: none;">
          </p>
         </form>
        </div>
        <!-- #respond -->
       </div>
       <!-- #comments -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          关注统计之都
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            新浪微博
            <a href="http://weibo.com/cosname">
             @统计之都
            </a>
           </li>
           <li>
            人人网
            <a href="http://renren.com/cosname">
             @统计之都
            </a>
           </li>
           <li>
            Twitter
            <a href="http://twitter.com/cos_name">
             @cos_name
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-6">
         <h3 class="widget-title">
          微信公众平台
         </h3>
         <div class="textwidget">
          <img src="http://cos.name/wp-content/uploads/2013/04/qrcode-8cm.jpg"/>
          <p style="font-size:12px;margin-left:15px">
           微信号 CapStat
          </p>
          <p>
           我们将第一时间向您推送主站和论坛的精彩内容，以及统计之都的线下活动、竞赛、培训和会议信息。
          </p>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-8">
         <h3 class="widget-title">
          站内导航
         </h3>
         <div class="textwidget">
          <ul>
           <li class="page_item">
            <a href="http://cos.name/cn/">
             中文论坛
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/videos/">
             视频
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/salon/">
             统计沙龙
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/books/">
             图书出版
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/training/">
             教育培训
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/about/">
             关于我们
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/donate/">
             捐赠
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/chinar/">
             R语言会议
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_links" id="linkcat-2">
         <h3 class="widget-title">
          友情链接
         </h3>
         <ul class="xoxo blogroll">
          <li>
           <a href="http://stat.ruc.edu.cn" target="_blank" title="中国人民大学统计学院网站">
            中国人民大学统计学院
           </a>
          </li>
          <li>
           <a href="http://rucdmc.net">
            中国人民大学数据挖掘中心
           </a>
          </li>
          <li>
           <a href="http://birc.gsm.pku.edu.cn/" target="_blank">
            北京大学商务智能研究中心
           </a>
          </li>
          <li>
           <a href="http://sam.cufe.edu.cn/" target="_blank" title="中央财经大学统计与数学学院网站">
            中央财经大学统计与数学学院
           </a>
          </li>
          <li>
           <a href="http://tjx.cueb.edu.cn/" target="_blank" title="首都经济贸易大学统计学院网站">
            首经贸统计学院
           </a>
          </li>
          <li>
           <a href="http://www.shookr.com/">
            数客网大数据社区
           </a>
          </li>
          <li>
           <a href="http://www.xueqing.tv/" target="_blank" title="数据科学在线学习平台">
            雪晴数据网
           </a>
          </li>
          <li>
           <a href="http://iera.name/" target="_blank" title="IERA是一个旨在普及、传播和增进工业工程知识的非营利性网站">
            IERA（直通IE）
           </a>
          </li>
         </ul>
        </aside>
        <aside class="widget widget_categories" id="categories-2">
         <h3 class="widget-title">
          全部分类
         </h3>
         <label class="screen-reader-text" for="cat">
          全部分类
         </label>
         <select class="postform" id="cat" name="cat">
          <option value="-1">
           选择分类目录
          </option>
          <option class="level-0" value="925">
           cos访谈  (4)
          </option>
          <option class="level-0" value="659">
           图书出版  (5)
          </option>
          <option class="level-0" value="379">
           数学方法  (14)
          </option>
          <option class="level-1" value="381">
           分析与代数  (1)
          </option>
          <option class="level-1" value="380">
           概率论  (9)
          </option>
          <option class="level-1" value="382">
           随机过程  (5)
          </option>
          <option class="level-0" value="210">
           数据分析  (81)
          </option>
          <option class="level-1" value="203">
           多元统计  (3)
          </option>
          <option class="level-1" value="42">
           数据挖掘与机器学习  (42)
          </option>
          <option class="level-1" value="36">
           生物与医学统计  (17)
          </option>
          <option class="level-1" value="35">
           计量经济学  (4)
          </option>
          <option class="level-1" value="296">
           金融统计  (3)
          </option>
          <option class="level-1" value="303">
           风险精算  (7)
          </option>
          <option class="level-0" value="177">
           模型专题  (15)
          </option>
          <option class="level-1" value="38">
           回归分析  (10)
          </option>
          <option class="level-1" value="41">
           时间序列  (2)
          </option>
          <option class="level-0" value="784">
           每周精选  (24)
          </option>
          <option class="level-1" value="183">
           可视化  (9)
          </option>
          <option class="level-0" value="967">
           沙龙纪要  (3)
          </option>
          <option class="level-0" value="18">
           经典理论  (46)
          </option>
          <option class="level-1" value="37">
           抽样调查  (3)
          </option>
          <option class="level-1" value="4">
           统计推断  (26)
          </option>
          <option class="level-1" value="236">
           试验设计  (7)
          </option>
          <option class="level-1" value="39">
           非参数统计  (3)
          </option>
          <option class="level-0" value="1">
           统计之都  (279)
          </option>
          <option class="level-1" value="884">
           中国R会议  (2)
          </option>
          <option class="level-1" value="885">
           中国R语言会议  (5)
          </option>
          <option class="level-1" value="446">
           出国留学  (3)
          </option>
          <option class="level-1" value="179">
           推荐文章  (90)
          </option>
          <option class="level-1" value="3">
           新闻通知  (75)
          </option>
          <option class="level-1" value="263">
           统计刊物  (10)
          </option>
          <option class="level-1" value="174">
           网站导读  (40)
          </option>
          <option class="level-1" value="204">
           职业事业  (51)
          </option>
          <option class="level-1" value="213">
           高校课堂  (9)
          </option>
          <option class="level-0" value="178">
           统计计算  (28)
          </option>
          <option class="level-1" value="40">
           优化与模拟  (15)
          </option>
          <option class="level-1" value="43">
           贝叶斯方法  (6)
          </option>
          <option class="level-0" value="378">
           软件应用  (116)
          </option>
          <option class="level-1" value="44">
           统计图形  (36)
          </option>
          <option class="level-1" value="110">
           统计软件  (83)
          </option>
         </select>
        </aside>
        <aside class="widget widget_recent_comments" id="recent-comments-2">
         <h3 class="widget-title">
          最新评论
         </h3>
         <ul id="recentcomments">
          <li class="recentcomments">
           <span class="comment-author-link">
            fineboom
           </span>
           发表在《
           <a href="http://cos.name/2016/06/use-shiny-fleetly-set-up-visual-prototype-system/#comment-7317">
            利用shiny包快速搭建可视化原型系统
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            胡家新
           </span>
           发表在《
           <a href="http://cos.name/2016/06/r%e8%af%ad%e5%8d%83%e5%af%bb%e7%ac%ac%e4%b8%89%e6%9c%9f%ef%bc%9a%e5%bc%a0%e6%97%a0%e5%bf%8c%e7%a9%b6%e7%ab%9f%e7%88%b1%e8%b0%81%ef%bc%9f/#comment-7316">
            R语千寻第三期：张无忌究竟爱谁？
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            <a class="url" href="http://www.zijiacha.com/category.php?id=6" rel="external nofollow">
             南糯山普洱茶
            </a>
           </span>
           发表在《
           <a href="http://cos.name/2016/06/r%e8%af%ad%e5%8d%83%e5%af%bb%e7%ac%ac%e4%b8%89%e6%9c%9f%ef%bc%9a%e5%bc%a0%e6%97%a0%e5%bf%8c%e7%a9%b6%e7%ab%9f%e7%88%b1%e8%b0%81%ef%bc%9f/#comment-7315">
            R语千寻第三期：张无忌究竟爱谁？
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            J
           </span>
           发表在《
           <a href="http://cos.name/2016/05/value-of-the-reputation-from-the-data/#comment-7314">
            数据告诉你：高信誉的卖家应该收高价，还是收低价？
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            <a class="url" href="http://gg" rel="external nofollow">
             Hilda
            </a>
           </span>
           发表在《
           <a href="http://cos.name/2013/01/drawing-map-in-r-era/#comment-7311">
            R时代，你要怎样画地图？
           </a>
           》
          </li>
         </ul>
        </aside>
        <aside class="widget widget_rss" id="rss-282869971">
         <h3 class="widget-title">
          <a class="rsswidget" href="http://cos.name/cn/topics/feed/">
           <img src="http://cos.name/wp-includes/images/rss.png"/>
          </a>
          <a class="rsswidget" href="http://cos.name/cn/topics/feed/">
           中文论坛新帖
          </a>
         </h3>
         <ul>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/417372/">
            处理时间数据和产生时间序列的问题
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/6790/">
            《统计陷阱》下载 （How to lie with statistics）
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/818/">
            统计学的世界（第五版）
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/16574/">
            class(x) 返回值值是AsIs,AsIs代表什么，有什么用处？
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/417366/">
            如何用R绘制一个分类算法的决策规则
           </a>
          </li>
         </ul>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          登录/RSS
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/wp-admin/">
             登录
            </a>
           </li>
           <li>
            <a href="http://cos.name/feed/" title="使用 RSS 2.0 同步站点内容">
             文章
             <abbr title="Really Simple Syndication">
              RSS
             </abbr>
            </a>
           </li>
           <li>
            <a href="http://cos.name/comments/feed/" title="RSS 上的最近评论">
             评论
             <abbr title="Really Simple Syndication">
              RSS
             </abbr>
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
   <p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <a href="http://www.wumii.com/widget/relatedItems" style="border:0;">
     <img src="http://static.wumii.cn/images/pixel.png"/>
    </a>
   </p>
  </div>
 </body>
</html>